<!-- 模型项详情弹窗 -->
<template>
            <a-form
                    ref="form3"
                    class="ele-form-detail"
                    :model="modelItemModalApp.modelItem"
                    :label-col="{md: {span: 2}, sm: {span: 4}, xs: {span: 6}}"
                    :wrapper-col="{md: {span: 22}, sm: {span: 20}, xs: {span: 18}}">
                <a-descriptions :title="modelItemModalApp.title" bordered>
                                    <a-descriptions-item label="标识">
                        {{ modelItemModalApp.modelItem.Eid }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="创建人">
                        {{ modelItemModalApp.modelItem.creatorName }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="名称">
                        {{ modelItemModalApp.modelItem.name }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="模型编辑方式">
                        {{ modelItemModalApp.modelItem.modelItemEditWay }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="模型项">
                        {{ modelItemModalApp.modelItem.modelItemName }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="模型数据类型">
                        {{ modelItemModalApp.modelItem.modelDataTypeId }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="数据范围">
                        {{ modelItemModalApp.modelItem.dataRange }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="长度">
                        {{ modelItemModalApp.modelItem.length }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="模型ID">
                        {{ modelItemModalApp.modelItem.modelId }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="检查方式">
                        {{ modelItemModalApp.modelItem.checkWay }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="检查正则表达式">
                        {{ modelItemModalApp.modelItem.checkRegex }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="检查消息">
                        {{ modelItemModalApp.modelItem.checkMessage }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="显示列">
                        {{ modelItemModalApp.modelItem.displayCol }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="非空">
                        {{ modelItemModalApp.modelItem.notNull }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="分类">
                        {{ modelItemModalApp.modelItem.sort }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="父ID">
                        {{ modelItemModalApp.modelItem.parentId }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="Splice模型项">
                        {{ modelItemModalApp.modelItem.spliceModelItemName }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="模型项类型">
                        {{ modelItemModalApp.modelItem.modelItemType }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="输入提示">
                        {{ modelItemModalApp.modelItem.inputTips }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="选择">
                        {{ modelItemModalApp.modelItem.options }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="数字">
                        {{ modelItemModalApp.modelItem.digits }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="交叉表名称">
                        {{ modelItemModalApp.modelItem.crossTableName }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="横排">
                        {{ modelItemModalApp.modelItem.crossRowName }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="交叉列名">
                        {{ modelItemModalApp.modelItem.crossColumnName }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="排列">
                        {{ modelItemModalApp.modelItem.array }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="状态">
                        {{ modelItemModalApp.modelItem.status }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="创建人ID">
                        {{ modelItemModalApp.modelItem.creatorId }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="备注">
                        {{ modelItemModalApp.modelItem.remark }}
                    </a-descriptions-item>
                                    <a-descriptions-item label="创建时间">
                        {{ modelItemModalApp.modelItem.createDatetime }}
                    </a-descriptions-item>
                                </a-descriptions>
            </a-form>
</template>

<script>
    import {defineComponent, reactive, onMounted, inject} from "vue";
    import {useRoute} from "vue-router"
    import {ModelItemService} from "@/views/lims/gen/modelItem/modelItemService";

    export default defineComponent({
        setup() {
            const route = useRoute();
            let routeId = route.params.id;
            let modelItemListApp = inject('modelItemListApp', reactive({}));
            const modelItemModalApp = reactive({id: null, modelItem: {}, display: false});

            onMounted(() => {
                    modelItemModalApp.modelItem = {};
                if (routeId) {
                        modelItemModalApp.id = routeId;
                } else if (modelItemListApp.viewModalShowing) {
                        modelItemModalApp.id = modelItemListApp.currentId;
                        modelItemModalApp.display = true;
                }
                if (modelItemModalApp.id) {
                    getInfo(modelItemModalApp.id);
                }
            })

            const getInfo = (id) => {
                    ModelItemService.findModelItem(id).then((res) => {
                            modelItemModalApp.modelItem = res.data;
                            modelItemModalApp.title = "查看 " + modelItemModalApp.modelItem.name;
                })
            }

            return {
                    modelItemModalApp,
                routeId,
                getInfo,
            }
        }
    })
</script>

<style scoped>
</style>

